var orderVm;
var pageIndex=0;
var pageSize=50;
var getDataListHttp;
$(function(){

    getDataListHttp=function(isRefresh){
        _getHttpsData2('/enterprise/listBySignupSafe?signupSafe=1','',
           function(res){
			   console.log(JSON.stringify(res))
			   for(var i=0;i<res.length;i++){
				   if(res[i].attachs && res[i].attachs.length>0){
				   		for(var j=0;j<res[i].attachs.length;j++){
				   			if(res[i].attachs[j].attFkName=='t_enterprise_env'){
				   				res[i].cover=res[i].attachs[j].attWebUrl;
				   			}
				   		}              		
				   }
			   }
               orderVm.enterList=res
			   orderVm.finished=true
           },
           function(err){         	
                vant.Toast.fail("网络异常"+err.readyState+":"+err.statusText+"("+err.status+")");
           }
       );
    }
 	
	onListItemClick=function(id){
		window.location.href='./shop_detail.html?id='+id;
	}

    orderVm = new Vue({
        el:'#order_id',
        data:{          
			loading: false,
			finished: false,
			refreshing: true,
            enterList:[]
        },
        methods:{
            onLoad:function(){
				getDataListHttp()
            },
            onRefresh:function(){
                this.refreshing=true;
                // 清空列表数据
                this.finished = false;
                // 重新加载数据
                // 将 loading 设置为 true，表示处于加载状态
                this.loading = true;
                this.onLoad();
            },
        }
    });
});